<template>
    <div class="reportFormPage" v-if="show">
        <div class="report-dom">
            <el-row>
                <el-col :span="5" :offset="19">
                    <div class="pageNumBox">
                        <span>第</span>
                        <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
                        <span>页，共</span>
                        <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
                        <span>页</span>
                    </div>
                </el-col>
            </el-row>
            <div class="topTwoBox">
                <div class="centerName">{{ this.form.baobmc }}</div>
                <div class="codeText">
                    <tr v-for="(item, index) in form.baobbhList">{{ item }}</tr>
                </div>
            </div>
            <div class="threeTopBox">
                <div class="left-border">
                    <div class="box-title">检测单位名称：</div>
                    <div class>{{ form.jiancdwmc }}</div>
                </div>
                <div class="right-border">
                    <span>记录编号：</span>
                    <span class="placeholder">{{ form.jilbh }}</span>
                </div>
            </div>
            <!-- .........................1111111111111111111111111111111......................................................... -->
            <div class="table-border">
                <table height="220px" class="top-table">
                    <tbody>
                    <tr>
                        <td height="30" align="center" width="15%">
                            <span style="width: 90px; display: inline-block">工程名称</span>
                        </td>
                        <td width="35%" class="text-center">
                            <span>{{ form.gongcmc }}</span>
                        </td>
                        <td align="center" width="15%">
                            <span style="width: 90px; display: inline-block">工程部位/用途</span>
                        </td>
                        <td width="35%" class="text-center">
                            <span>{{ form.gongcbwyt }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td height="50" align="center">样品信息</td>
                        <td class="specimen-border" colspan="3">
                            <span>样品名称：</span>
                            <span :class="{ 'placeholder': !form.yangpmc }">{{ form.yangpmc }}</span>
                            <span>；样品编号：</span>
                            <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>
                            <span>；样品数量：</span>
                            <span :class="{ 'placeholder': !form.yangpsl }">{{ form.yangpsl }}</span>
                            <span>；样品状态：</span>
                            <span :class="{ 'placeholder': !form.yangpzt }">{{ form.yangpzt }}</span>
                            <span>；来样时间：</span>
                            <span :class="{ 'placeholder': !form.yangpsj }">{{ form.yangpsj }}</span>
                        </td>
                    </tr>

                    <tr>
                        <td height="25" align="center" width="15%">
                            <span style="width: 90px; display: inline-block">试验检测日期</span>
                        </td>
                         <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
                        <td align="center" width="15%">
                            <span style="width: 90px; display: inline-block">试验条件</span>
                        </td>
                        <td v-if="isPdf" width="35%">
                            温度：
                            <span style="display: inline-block; width: 10%;">{{ form.shiytjwd }}</span>
                            ℃；湿度：
                            <span style="display: inline-block; width: 10%;">{{ form.shiytjsd }}</span>%RH
                        </td>
                        <td v-else width="35%">
                            温度：
                            <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" style="width: 15%"/>
                            ℃；湿度：
                            <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" style="width: 15%"/>
                            %RH
                        </td>
                    </tr>

                    <tr>
                        <td height="50" align="center" width="15%">
                            <span style="width: 90px; display: inline-block">检测依据</span>
                        </td>
                        <td width="35%">
                            <span v-if="isPdf">{{ form.jiancyj }}</span>
                            <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark"
                                      @dblclick.native="showBsJiancyjView" readonly/>
                        </td>
                        <td align="center" width="15%">
                            <span style="width: 90px; display: inline-block">判定依据</span>
                        </td>
                        <td width="35%">
                            <span v-if="isPdf">{{ form.pandyj }}</span>
                            <el-input v-else type="textarea" v-model="form.pandyj" :rows="2"
                                      @dblclick.native="showBsJudgeBaseView"
                                      @focus="handleFocus('pandyj')" class="mark"/>
                        </td>
                    </tr>
                    <tr class="bottom-border">
                        <td height="50" align="center">
                            <div>主要仪器设备</div>
                            <div>名称及编号</div>
                        </td>
                        <td colspan="3">
                            <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                            <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh"
                                      class="height100 width100 mark"
                                      @dblclick.native="showBsInstrumentView" readonly></el-input>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <!-- .................................22222222222222222222222222222222............................................... -->
                <table height="580px" class="middle-table">
                    <tbody>
                    <tr trindex="0">
                        <td colspan="6">
                            <div>坚固性试验</div>
                        </td>
                    </tr>
                    <tr trindex="1">
                        <td width="15%">
                            <div>公称粒级（mm）</div>
                        </td>
                        <td width="20%">
                            <div>各粒级试样试验前的烘干质量m<sub>i</sub>（g）</div>
                        </td>
                        <td width="20%">
                            <div>试验后各粒级筛余颗粒的烘干质量m'<sub>i</sub>（g）</div>
                        </td>
                        <td width="15%">
                            <div>各粒级试样的分计质量损失百分率（%）</div>
                        </td>
                        <td width="15%">
                            <div>试样中各粒级的分计质量m<sub>i</sub>（g）</div>
                        </td>
                        <td width="15%">
                            <div>试样的总质量损失百分率（%）</div>
                        </td>
                    </tr>
                    <tr v-for="(item, index) in form.detailList">
                        <td width="15%">
                            <div>{{ item.jiangxsygclj }}</div>
                        </td>
                        <td width="20%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="item.jiangxsygljsysyqhgzl"
                                      @change="computeList"
                                      @keydown.native="handleKeyDown($event, index, 0)"
                                      @paste.native="handlePasteDetailList($event,  index, 0)"
                                      :ref="`${index}_0`"/>
                        </td>
                        <td width="20%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="item.jiangxsyhgljsyklhgzl"
                                      @change="computeList"
                                      @keydown.native="handleKeyDown($event, index, 1)"
                                      @paste.native="handlePasteDetailList($event,  index, 1)"
                                      :ref="`${index}_1`"/>
                        </td>
                        <td width="15%">
                            <div>{{ item.jiangxsygljfjzlssbfl }}</div>
                        </td>
                        <td width="15%">
                            <div>{{ item.jiangxsygljfjzl }}</div>
                        </td>
                        <td width="15%" v-if="index == 0" :rowspan="form.detailList.length">
                            <div>{{ item.jiangxsyssbfl }}</div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <div>软弱颗粒含量试验</div>
                        </td>
                    </tr>
                    <tr>
                        <td width="15%">
                            <div>试样总质量</div>
                        </td>
                        <td width="20%">
                            <div>公称粒级(mm)</div>
                        </td>
                        <td width="20%">
                            <div>试样各粒级颗粒总质量m<sub>1</sub>(g)</div>
                        </td>
                        <td width="15%">
                            <div>试验后各粒级完好颗粒总质量m<sub>2</sub>(g)</div>
                        </td>
                        <td width="30%" colspan="2">
                            <div>软弱颗粒含量测定值(%)</div>
                        </td>
                    </tr>
                    <tr>
                        <td width="15%" rowspan="3">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.shiyzzlItem1"
                                      @change="compute()" @keydown.native="handleKeyDown($event, 5, 0)" :ref="'5_0'"/>
                        </td>
                        <td width="20%">
                            <div>{{ this.form.gongcljItem1 }}</div>
                        </td>
                        <td width="20%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="form.shiygljklzzlItem1"
                                      @change="compute()"
                                      @keydown.native="handleKeyDown($event, 5, 1)"
                                      @paste.native="handlePaste($event, 0, 0)"
                                      :ref="'5_1'"/>
                        </td>
                        <td width="15%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="form.shiyhgljklzzlItem1"
                                      @change="compute()"
                                      @keydown.native="handleKeyDown($event, 5, 2)"
                                      @paste.native="handlePaste($event, 0, 1)"
                                      :ref="'5_2'"/>
                        </td>
                        <td width="30%" colspan="2" rowspan="3">
                            <div>{{ this.form.ruanrklhlczPjz }}</div>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <div>{{ this.form.gongcljItem2 }}</div>
                        </td>
                        <td width="20%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="form.shiygljklzzlItem2"
                                      @change="compute()"
                                      @keydown.native="handleKeyDown($event, 6, 1)"
                                      @paste.native="handlePaste($event, 1, 0)"
                                      :ref="'6_1'"/>
                        </td>
                        <td width="15%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="form.shiyhgljklzzlItem2"
                                      @change="compute()"
                                      @keydown.native="handleKeyDown($event, 6, 2)"
                                      @paste.native="handlePaste($event, 1, 1)"
                                      :ref="'6_2'"/>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <div>{{ this.form.gongcljItem3 }}</div>
                        </td>
                        <td width="20%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="form.shiygljklzzlItem3"
                                      @change="compute()"
                                      @keydown.native="handleKeyDown($event, 7, 1)"
                                      @paste.native="handlePaste($event, 2, 0)"
                                      :ref="'7_1'"/>
                        </td>
                        <td width="15%">
                            <el-input :type="isPdf ? 'string' : 'number'" tabindex="200"
                                      v-model="form.shiyhgljklzzlItem3"
                                      @change="compute()"
                                      @keydown.native="handleKeyDown($event, 7, 2)"
                                      @paste.native="handlePaste($event, 2, 1)"
                                      :ref="'7_2'"/>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <!-- .....................................................33333333333333333................................................... -->
                <table height="80px" class="bottom-table">
                    <tr>
                        <td>
                            <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
                            <el-input v-else type="textarea" :rows="2" v-model="form.fujsm"
                                      @focus="handleFocus('fujsm')"/>
                        </td>
                    </tr>
                </table>
            </div>
            <!-- .................................44444444444............................................. -->
            <table height="22px" class="transparent">
                <tbody>
                <tr>
                    <td width="10%" align="right">检测：</td>
                    <td width="15%" align="left">
                        <!-- {{this.form.jiancr}} -->
                    </td>
                    <td width="10%" align="right">记录：</td>
                    <td width="15%" align="left">
                        <!-- {{this.form.jilr}} -->
                    </td>
                    <td width="10%" align="right">复核：</td>
                    <td align="left" width="15%">
                        <!-- {{this.form.fuhr}} -->
                    </td>
                    <td width="10%">日期：</td>
                    <td align="left" width="15%">
                        <div style="display: inline-block; margin-right: 30px;">年</div>
                        <div style="display: inline-block; margin-right: 30px;">月</div>
                        <div style="display: inline-block;">日</div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
        <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
        <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
    </div>
</template>

<script>
import {handleFocus, emptyConvert, uniqueStr, handleKeyDown, handlePaste} from "@/views/reportForms/utils";
import {getCjljgxrrkljlbBsInfo} from "@/api/report_jl/cjl";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";

import decimal from "@/utils/big-decimal";
import Bus from "@/utils/bus";

export default {
    name: "cjljgxrrkljlbTable",
    components: {
        BsInstrumentView,
        BsJiancyjView,
        BsJudgeBaseView
    },
    props: {
        excelId: {
            type: [String, Number],
            default: () => ""
        },
        syType: {
            type: [String, Number],
            default: () => ""
        },
        page: {
            type: Number,
            default: () => 0
        },
        isPdf: {
            type: Boolean,
            default: () => false
        },
        printEmpty: {
            type: Boolean,
            default: () => false
        }
    },
    data() {
        return {
            form: {
                detailList: [],
                baobbhList: []
            },
            show: false,
            showQyxx: false,
            backBgz: {}
        };
    },

    created() {
        this.init();
    },
    watch: {
        isPdf(newVal, oldVal) {
            this.form = {...emptyConvert(this.form, newVal)};
        },
        backBgz: {
            handler(newVal, oldVal) {
                this.backBgzFun();
            }
        },
        "form.shiyzzlItem1": {
            handler(newVal, oldVal) {
                if (newVal) {
                    this.form.shiyzzlItem2 = newVal;
                    this.form.shiyzzlItem3 = newVal;
                }
            }
        }
    },
    methods: {
        // 根据报表id获取当前报表信息
        init() {
            this.show = false;
            getCjljgxrrkljlbBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
                this.form = response.data;
                if (!this.form.fujsm) {
                    this.form.fujsm = "附加声明：";
                }
                this.setInitialValue();
                if (!this.form.detailList || this.form.detailList.length <= 0) {
                    this.getDetailList();
                }
                this.show = true;
            });
        },
        // 设置初始值
        setInitialValue() {
            if (this.form) {
                this.form.baobmc = this.form.baobmc || "粗集料坚固性、软弱颗粒含量试验检测记录表";
                this.form.baobbh = this.form.baobbh || "JGLQ02008,JGLQ02034";
                this.$set(this.form, "baobbhList", []);
                this.form.baobbhList = ["JGLQ02008", "JGLQ02034"];
                this.form.gongcljItem1 = this.form.gongcljItem1 || "4.75-9.5";
                this.form.gongcljItem2 = this.form.gongcljItem2 || "9.5-16";
                this.form.gongcljItem3 = this.form.gongcljItem3 || "＞16";
            }
        },
        getDetailList() {
            this.$set(this.form, "detailList", []);
            const detail1 = {
                detailId: null,
                excelId: this.excelId,
                jiangxsygclj: "2.36～4.75",
                jiangxsygljsysyqhgzl: null,
                jiangxsyhgljsyklhgzl: null,
                jiangxsygljfjzlssbfl: null,
                jiangxsygljfjzl: null,
                jiangxsysyzzl: null,
                jiangxsyssbfl: null
            };
            const detail2 = {
                detailId: null,
                excelId: this.excelId,
                jiangxsygclj: "4.75～9.5",
                jiangxsygljsysyqhgzl: null,
                jiangxsyhgljsyklhgzl: null,
                jiangxsygljfjzlssbfl: null,
                jiangxsygljfjzl: null,
                jiangxsysyzzl: null,
                jiangxsyssbfl: null
            };
            const detail3 = {
                detailId: null,
                excelId: this.excelId,
                jiangxsygclj: "9.5～19",
                jiangxsygljsysyqhgzl: null,
                jiangxsyhgljsyklhgzl: null,
                jiangxsygljfjzlssbfl: null,
                jiangxsygljfjzl: null,
                jiangxsysyzzl: null,
                jiangxsyssbfl: null
            };
            const detail4 = {
                detailId: null,
                excelId: this.excelId,
                jiangxsygclj: "19～37.5",
                jiangxsygljsysyqhgzl: null,
                jiangxsyhgljsyklhgzl: null,
                jiangxsygljfjzlssbfl: null,
                jiangxsygljfjzl: null,
                jiangxsysyzzl: null,
                jiangxsyssbfl: null
            };
            const detail5 = {
                detailId: null,
                excelId: this.excelId,
                jiangxsygclj: "37.5～63",
                jiangxsygljsysyqhgzl: null,
                jiangxsyhgljsyklhgzl: null,
                jiangxsygljfjzlssbfl: null,
                jiangxsygljfjzl: null,
                jiangxsysyzzl: null,
                jiangxsyssbfl: null
            };
            this.form.detailList.push(detail1);
            this.form.detailList.push(detail2);
            this.form.detailList.push(detail3);
            this.form.detailList.push(detail4);
            this.form.detailList.push(detail5);
        },
        // 显示仪器列表
        showBsInstrumentView() {
            this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
        },
        // 仪器选择
        selectInstrument(info) {
            this.form.zhuyyqsbmcjbh = info.label;
            this.form.shebIds = info.ids;
            Bus.$emit("setCjlBgZhuyyqsbmcjbh", {zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds});
        },
        // 显示检测依据列表
        showBsJiancyjView() {
            this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
        },
        // 检测依据选择
        selectJiancyj(info) {
            this.form.jiancyj = info.label;
            this.form.jiancyjIds = info.ids;
            Bus.$emit("setCjlBgJiancyj", {jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds});
        },
        // 显示判定依据列表
        showBsJudgeBaseView() {
            this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
        },
        // 判断依据选择
        selectJudge(info) {
            if (!this.form.pandyj) {
                this.form.pandyj = info.label;
                return;
            }
            if (info && info.label) {
                this.form.pandyj += "、" + info.label;
            }
        },
        // 返回报告引入值
        backBgzFun() {
            Bus.$emit("setCjlBgJiancjg", [
                {key: 21, value: this.form.detailList[0].jiangxsyssbfl},
                {key: 27, value: this.form.ruanrklhlczPjz}
            ]);
        },
        submitForm() {
            return this.form;
        },
        handleFocus(event) {
            handleFocus(event, this.page, this.form[event]);
        },
        computeList() {
            if (!this.form.detailList || this.form.detailList.length <= 0) {
                return;
            }
            const newVal = this.form.detailList;
            let e,
                f = 0;
            for (let i = 0; i < newVal.length; i++) {
                if (newVal[i]) {
                    e = decimal.add(e, newVal[i].jiangxsygljsysyqhgzl);
                    f = decimal.add(f, newVal[i].jiangxsyhgljsyklhgzl);
                }
            }
            for (let i = 0; i < newVal.length; i++) {
                if (newVal[i] && newVal[i].jiangxsygljsysyqhgzl && newVal[i].jiangxsyhgljsyklhgzl && newVal[i].jiangxsygljsysyqhgzl != 0) {
                    const a = decimal.subtract(newVal[i].jiangxsygljsysyqhgzl, newVal[i].jiangxsyhgljsyklhgzl);
                    const b = decimal.multiply(100, a);
                    const c = decimal.divide(b, newVal[i].jiangxsygljsysyqhgzl);
                    newVal[i].jiangxsygljfjzlssbfl = c;
                } else {
                    newVal[i].jiangxsygljfjzlssbfl = null;
                }
                if (newVal[i] && e != 0) {
                    const d = decimal.divide(newVal[i].jiangxsygljsysyqhgzl, e);
                    newVal[i].jiangxsygljfjzl = d;

                    const h = decimal.multiply(100, e);
                    const j = decimal.divide(f, e);
                    const k = decimal.subtract(h, j);
                    newVal[i].jiangxsyssbfl = k;
                    this.$set(this.backBgz, "jiangxsyssbfl", newVal[i].jiangxsyssbfl);
                } else {
                    newVal[i].jiangxsygljfjzl = null;
                    newVal[i].jiangxsyssbfl = null;
                    this.$set(this.backBgz, "jiangxsyssbfl", newVal[i].jiangxsyssbfl);
                }
            }
        },
        // 计算
        compute() {
            const a = decimal.add(this.form.shiygljklzzlItem1 || 0, this.form.shiygljklzzlItem2 || 0);
            const b = decimal.add(a, this.form.shiygljklzzlItem3 || 0);
            const c = decimal.subtract(b, this.form.shiyhgljklzzlItem1 || 0);
            const d = decimal.subtract(c, this.form.shiyhgljklzzlItem2 || 0);
            const e = decimal.subtract(d, this.form.shiyhgljklzzlItem3 || 0);
            const f = decimal.multiply(100, e);
            if (b != 0) {
                const g = decimal.divide(f, b);
                this.form.ruanrklhlczPjz = g;
            } else {
                this.form.ruanrklhlczPjz = null;
            }
            this.backBgzFun();
        },
        handleKeyDown(event, rowIndex, colIndex) {
            const maxArr = [1, 1, 1, 1, 1, 2, 2, 2]; // 每一行最多有多少可聚焦输入框（从0开始）
            const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
            const arr = ref.split("_");
            if (arr[0] <= 4) {
                if (this.$refs[ref][0]) {
                    this.$refs[ref][0].focus();
                }
            } else {
                if (arr[0] >= 6 && arr[1] == 0) {
                    this.handleKeyDown(event, arr[0], arr[1]);
                    return;
                }
                if (this.$refs[ref]) {
                    this.$refs[ref].focus();
                }
            }

        },
        // 粘贴赋值方法
        handlePaste(event, rowIndex, colIndex) {
            const nameAllArr = [
                ["shiygljklzzlItem1", "shiyhgljklzzlItem1"],
                ["shiygljklzzlItem2", "shiyhgljklzzlItem2"],
                ["shiygljklzzlItem3", "shiyhgljklzzlItem3"],
            ];
            const subscriptArr = [
                [0, 1],
                [0, 1],
                [0, 1],
            ];

            const methodsAllArr = [
                ["compute", "compute"],
                ["compute", "compute"],
                ["compute", "compute"],
            ];
            const parameterArr = [
                [null, null],
                [null, null],
                [null, null],
            ];
            const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
            const {cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr} = data;
            for (let a = 0; a < nameSetArr.length; a++) {
                for (let b = 0; b < nameSetArr[a].length; b++) {
                    this.form[nameSetArr[a][b]] = cols[a][b];
                }
            }
            for (let a = 0; a < methodsSetArr.length; a++) {
                for (let b = 0; b < methodsSetArr[a].length; b++) {
                    // if (methodsSetArr[a][b] == "calculateShitzl") {
                    // console.log(methodsSetArr[a][b], subscriptArr[a][b]);

                    this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b]);
                    // } else {
                    // this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b][0], parameterSetArr[a][b][1]);
                    // }
                }
            }
        },

        // detailList粘贴赋值方法
        handlePasteDetailList(event, rowIndex, colIndex) {
            const nameAllArr = this.form.detailList.map((item, index) => {
                return ["jiangxsygljsysyqhgzl", "jiangxsyhgljsyklhgzl"]
            });
            const subscriptArr = this.form.detailList.map((item, index) => {
                return [0, 1]
            });
            const methodsAllArr = this.form.detailList.map((item, index) => {
                return ["computeList", "computeList"]
            });
            const parameterArr = this.form.detailList.map((item, index) => {
                return [null, null]
            });

            const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
            const {cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr} = data;
            for (let a = 0; a < nameSetArr.length; a++) {
                for (let b = 0; b < nameSetArr[a].length; b++) {
                    this.form.detailList[rowIndex + a][nameSetArr[a][b]] = cols[a][b];
                }
            }
            for (let a = 0; a < methodsSetArr.length; a++) {
                for (let b = 0; b < methodsSetArr[a].length; b++) {
                    // if (methodsSetArr[a][b] == "calculateShitzl") {
                    // console.log(methodsSetArr[a][b], subscriptArr[a][b]);

                    this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b]);
                    // } else {
                    // this.setCalculate(methodsSetArr[a][b], parameterSetArr[a][b][0], parameterSetArr[a][b][1]);
                    // }
                }
            }
        },

        // 计算方法调用
        setCalculate(name, a, b, c, d, e) {
            this[name](a, b, c, d, e);
        }
    }
};
</script>

<style scoped lang="scss"></style>
